package cn.yunhe.biz;

import java.util.List;

import cn.yunhe.dao.CateDaoImplByMybatis;
import cn.yunhe.dao.ICateDao;
import cn.yunhe.model.Cate;

public class CateBizImpl implements ICateBiz {
	ICateDao cateDao=new CateDaoImplByMybatis();
	
	public boolean addCate(Cate cate) {
		int flag=cateDao.addCate(cate);
		if(flag>0){
			return true;
		}else{
			return false;
		}
		
	}


	public List<Cate> searchAll() {
		
		return cateDao.searchAll();
	}



	public Cate getCateById(int cateId) {
		
		return cateDao.getCateById(cateId);
	}


	
	public boolean updateCateById(Cate cate) {
		int flag=cateDao.updateCateById(cate);
		if(flag>0){
			return true;
		}else{
			return false;
		}
	}


	
	public boolean deleteCateById(int cateid) {
		int flag=cateDao.deleteCateById(cateid);
		if(flag>0){
			return true;
		}else{
			return false;
		}
		
	}



	public List<Cate> searchByPage(int pageSize, int currPage) {
		
		return cateDao.searchByPage(pageSize, currPage);
	}



	public int getCount() {
		
		return cateDao.getCateCount();
	}


	@Override
	public List<Cate> searchByCate(Cate cate) {
		// TODO Auto-generated method stub
		return cateDao.searchByCate(cate);
	}

}
